abstract class Person {
  String name;

  abstract void operation();
}

abstract class Decorator extends Person {
  Person person;
}

class Student extends Person {

  Student(String name) {
    this.name = name;
  }

  void operation() {
    System.out.println("name: " + name);
  }

}

class ConcreteDecoratorA extends Decorator {

  ConcreteDecoratorA(Person person) {
    this.person = person;
  }

  void operation() {
    person.operation();
    System.out.println("ConcreteDecotatorA addtion operation");
  }

  void addedState() {
  }
}

class ConcreteDecoratorB extends Decorator {
  
  ConcreteDecoratorB(Person person) {
    this.person = person;
  }
  
  void operation() {
    person.operation();
    System.out.println("ConcreteDecoratorB addtion operation");
  }

  void addedBehavior() {
  }
}

class test {
  public static void main(String[] args) {
    Person zhanshan = new Student("zhanshan");
    //zhanshan.operation();

    zhanshan = new ConcreteDecoratorA(zhanshan);
    zhanshan.operation();

    System.out.println("----------------1-----------------");

    zhanshan = new ConcreteDecoratorB(zhanshan);
    zhanshan.operation();

    System.out.println("----------------2-----------------");

    Person lisi = new ConcreteDecoratorB(new ConcreteDecoratorA(new Student("zhanshan")));
    lisi.operation();

    }
}